package agricultural;

import strategy.WorkStrategy;
import strategy.impl.AdjustedTractorStrategy;
import strategy.impl.NormalTractorStrategy;

public class Tractor extends AgriculturalMachine {
    public Tractor(String machineId) {
        super(machineId);
        this.workStrategy = new NormalTractorStrategy();
    }

    @Override
    public void adjustToEnvironment(double soilMoisture, int cropGrowthStatus, String weatherData) {
        System.out.println(machineId + "收到环境数据更新通知");
        if (soilMoisture > 80) {
            setWorkStrategy(new AdjustedTractorStrategy());
        } else {
            setWorkStrategy(new NormalTractorStrategy());
        }
        performWork();
    }


    @Override
    public void update(double soilMoisture, int cropGrowthStatus, String weatherData) {

    }
}